package com.hongyue.lianXi;

import java.util.Arrays;

public class Demo {
    public static void main(String[] args) {
        long l = System.currentTimeMillis();
        int[] a = {12, 21, 2, 3, 24, 15, 12, 23, 12};
        for (int i = 0; i < a.length; i++) {
            for (int j = 0; j < a.length - 1 - i; j++) {
                if (a[j] > a[j + 1]) {
                    int b = a[j];
                    a[j] = a[j + 1];
                    a[j + 1] = b;
                }
            }
        }
        System.out.println(Arrays.toString(a));
        long i = System.currentTimeMillis();
        System.out.println(i - l);
    }
}
